package com.kb.design.controller;

import cn.hutool.core.codec.Base64;
import com.google.common.collect.ImmutableMap;
import com.kb.design.common.ApiResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * 代码生成 操作处理
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/synData")
public class SynDataController {
    @Value("${constant.file.url:http://192.168.10.33:8012/onlinePreview?url=}")
    private String fileUrl;


    @PostMapping("/data")
    public ApiResponse getData(String url) {
        Map<String, String> urlMap = ImmutableMap.of("url", fileUrl + Base64.encode(url));
        return ApiResponse.success(urlMap);
    }

    public static void main(String[] args) {

//        MessageUtil.sentMessage("23988","测试数据呵呵哈哈哈或");
//        MessageUtil.sentMessageToAssistant("23988","大大");
    }

}